package com.sskj.gocoin.p.activity;

import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;
import com.sskj.gocoin.MyAppLication;
import com.sskj.gocoin.common.Constants;
import com.sskj.gocoin.m.HttpConfig;
import com.sskj.gocoin.m.bean.HttpData;
import com.sskj.gocoin.m.http.JsonCallBack;
import com.sskj.gocoin.p.base.BasePresenter;
import com.sskj.gocoin.utils.SPUtils;
import com.sskj.gocoin.utils.ToastUtil;
import com.sskj.gocoin.v.activity.VerifyIdentActivity;

import java.io.File;
import java.util.HashMap;

/**
 * Created by Administrator on 2018/4/3 0003.
 */

public class VerifyIdentPresenter extends BasePresenter<VerifyIdentActivity> {
    public void submitVerify( HashMap<String, Object> params) {
        OkGo.<HttpData>post(HttpConfig.BASE_URL + HttpConfig.IDENT_HIGH)
                .isMultipart(false)
                .params("cardimg1", (File) params.get("photo_a"), (String) params.get("photoAName"))
                .params("cardimg2", (File) params.get("photo_b"), (String) params.get("photoBName"))
                .execute(new JsonCallBack<HttpData>(this) {
                    @Override
                    public void _onSuccess(Response<HttpData> response) {
                        HttpData body = response.body();
                        if (body.getCode() == 200) {
                            mView.onSubmitVerifyResponseSuccess();
                        } else {
                            ToastUtil.showShort(body.msg);
                        }
                    }
                });
    }




}
